﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Practice
{
    public partial class ArmourHero : Form
    {
        public ArmourHero()
        {
            InitializeComponent();
        }

        private void ArmourHero_Load(object sender, EventArgs e)
        {
            // TODO: 这行代码将数据加载到表“cShapeDataSet.ArmorHero”中。您可以根据需要移动或删除它。
            
            string conString = "server=.;database=CShape;uid=sa;pwd=1922010135zk";

            SqlConnection sqlConnection = new SqlConnection(conString);

            string cmdString = "select * from ArmorHero";

            SqlDataAdapter dataAdapter = new SqlDataAdapter(cmdString,sqlConnection);

            DataTable dataTable = new DataTable();

            sqlConnection.Open();

            dataAdapter.Fill(dataTable);

            dataGridView1.DataSource = dataTable;
        }
    }
}
